﻿using Logistics.Apply;
using Logistics.Car;
using Logistics.Contract;
using Logistics.Data;
using Logistics.examination;
using Logistics.Job;
using Logistics.Maintainss;
using Logistics.Oper;
using Logistics.Operators;
using Logistics.PersonnelMatters;
using Logistics.Remit;
using Logistics.Setup;
using Logistics.SignIn;
using Logistics.Statist;
using Logistics.Track;
using Logistics.Violations;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using MyMiddleware;

namespace Logistics.Web
{
    public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            
            services.AddRazorPages().AddRazorRuntimeCompilation();
            services.AddScoped<IFieIdRepository, FieIdRepository>();
            services.AddScoped<IVehicleAppService, VehicleAppService>();
            services.AddScoped<IVehicleRepository, VehicleRepository>();
            services.AddScoped<ISignInRepository, SignInRepository>();
            services.AddScoped<ISignInAppService, SignInAppService>();
            services.AddScoped<IPersonnelMattersRepository, PersonnelMattersRepository>();
            services.AddScoped<IPersonnelMattersAppService, PersonnelMattersAppService>();
            services.AddScoped<IPowerManagerRepository, PowerManagerRepository>();
            services.AddScoped<ICargoownerContractAppService, CargoownerContractAppService>();
            services.AddScoped<ICargoownerContractRepository, CargoownerContractRepository>();
            services.AddScoped<ICurrencyContractRepository, CurrencyContractRepository>();
            services.AddScoped<ICurrencyContractAppService, CurrencyContractAppService>();
            services.AddScoped<ICarryContractAppService, CarryContractAppService>();
            services.AddScoped<IFieIdAppService, FieIdAppService>();
            services.AddScoped<IOwnerRepository, OwnerRepository>();
            services.AddScoped<IOwnerAppService, OwnerAppService>();
            services.AddScoped<ILineRepository, LineRepository>();
            services.AddScoped<ILineAppService, LineAppService>();
            services.AddScoped<ICarryTrackAppService, CarryTrackAppService>();
            services.AddScoped<ICarryTrackRepository, CarryTrackRepository>();
            services.AddScoped<IApprovalactivityAppService, ApprovalactivityAppService>();
            services.AddScoped<IApprovalActivityRepository, ApprovalActivityRepository>();
            services.AddScoped<ICostRepository, CostRepository>();
            services.AddScoped<ICostAppService, CostAppService>();
            services.AddScoped<IJobAppService, JobAppService>();
            services.AddScoped<IStatitsAppService, StatisticsAppService>();
            services.AddScoped<IPaymentAppService, PaymentAppService>();
            services.AddScoped<IInvoiceAppService, InvoiceAppService>();
            services.AddScoped<IOperatorsAppService, OperatorsAppService>();
            services.AddScoped<ICargoownerTrackAppService, CargoownerTrackAppService>();
            services.AddScoped<ICargoownerTrackRepository, CargoownerTrackRepository>();
            //services.AddScoped<IViolationAppService, ViolationAppService>();
            services.AddApplication<LogisticsWebModule>();
        }
        

        public void Configure(IApplicationBuilder app)
        {
            // 启用日志追踪记录和异常友好提示
            app.UseLogMiddleware();
            app.InitializeApplication();
        }

    }
}
